﻿module Sustainalytics.Portfolio {
    // ShowErrorsInModal controller
    export class ShowErrorsInModalController {
        // Ctor.
        constructor(
            private $rootScope: ng.IScope,
            private $scope: ng.IScope,
            private $q: ng.IQService,
            private $location: ng.ILocationService,
            private notificationFactory: Common.INotificationFactory,
            private $modal: Common.IModal,
            private $modalInstance: Common.IModalInstance,
            private errors: string) {

            var ctx = this;
            $scope["portfolioErrors"] = ctx;
        }

        public closeDialog = function () {
            var ctx = this;
            ctx.resultCheck = false;
            ctx.$modalInstance.close({ check: ctx.resultCheck });
        };
    }

    // register controller with News Angular module
    angular.module('Sustainalytics.Portfolio').controller('ShowErrorsInModalController', function ($rootScope: ng.IScope, $scope: ng.IScope, $q: ng.IQService, $location: ng.ILocationService, notificationFactory: Common.INotificationFactory, $modal: Common.IModal, $modalInstance: Common.IModalInstance, errors: string) {
        var ctrl = new Sustainalytics.Portfolio.ShowErrorsInModalController($rootScope, $scope, $q, $location, notificationFactory, $modal, $modalInstance, errors);
        return ctrl;
    });
} 
